package com.yurun.organizationmodule.mapper;

import com.yurun.commonapi.pojo.Employee;
import com.yurun.commonapi.pojo.OrganizationInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigInteger;
import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface OrganizationMapper {

    List<OrganizationInfo> getAllOrganizationList();

    int addOrg(OrganizationInfo organizationInfo);

    List<String> getOrgOption();

    List<OrganizationInfo> getOneOrgInfoByName(String organizationName);

    OrganizationInfo getOneOrgInfoById(BigInteger organizationId);

    int editOrgById(OrganizationInfo organizationInfo);

    int delOrgById(@Param("organizationId") BigInteger organizationId, @Param("time") Date time);

    int addFirstEmployeeId(Employee employee);

    BigInteger orgIdIsRepeat(BigInteger organizationId);

    int delBranchByOrgId(@Param("organizationId") BigInteger organizationId, @Param("time") Date time);

    int delEmployeeByOrgId(@Param("organizationId") BigInteger organizationId, @Param("time") Date time);

    int delTeacherByOrgId(@Param("organizationId") BigInteger organizationId, @Param("time") Date time);

    int delStudentByOrgId(@Param("organizationId") BigInteger organizationId, @Param("time") Date time);

    List<BigInteger> getAdminEmployeeId(BigInteger organizationId);

    List<Integer> getAdminAllPermission(int categoryId);

    List<Integer> getMenuListByRole(int roleId);

    List<Integer>  getPermissionByRole(int roleId);
}
